import os

version_i = 5.2
version_s = 'v{}'.format(version_i)

base_path = f'{os.getcwd()}/'
original_video_name = ''
original_srt_name = ''
original_video_file = ''
original_srt_file = ''
voice_local_url = ''

url_version = 'http://139.155.86.248:8078/mv/config?state=3'
url_config = 'http://139.155.86.248:8078/mv/config?state=1'
url_dubbing = 'http://139.155.86.248:8078/mv/dubbing'
url_jy_effect = 'http://139.155.86.248:8078/mv/effect'

ali_key = None
ali_model = None
baidu_id = None
baidu_key = None
change_type = None
voice_type = None

voices_role_list = []
role_dict = {}
jy_effect_list = []
effect_list = ['fadeblack', 'fadegrays', 'fadewhite', 'zoomin']
# 'coverleft', 'coverright', 'coverup','hblur' 'coverleft','coverright', 'coverup','circlecrop','rectcrop'可用
# 'coverdown' 'revealup' 'slidedown', 'slideleft','slideright', 'slideup', 'squeezeh','squeezev',

draft_content_data = {
    "canvas_config": {
        "height": 0,
        "ratio": "original",
        "width": 0
    },
    "color_space": 0,
    "config": {
        "adjust_max_index": 1,
        "attachment_info": [],
        "combination_max_index": 1,
        "export_range": None,
        "extract_audio_last_index": 1,
        "lyrics_recognition_id": "",
        "lyrics_sync": True,
        "lyrics_taskinfo": [],
        "maintrack_adsorb": True,
        "material_save_mode": 0,
        "original_sound_last_index": 1,
        "record_audio_last_index": 1,
        "sticker_max_index": 1,
        "subtitle_recognition_id": "",
        "subtitle_sync": True,
        "subtitle_taskinfo": [],
        "system_font_list": [],
        "video_mute": False,
        "zoom_info_params": None
    },
    "cover": None,
    "create_time": 0,
    "duration": 20000000,
    "extra_info": None,
    "fps": 30.0,
    "free_render_index_mode_on": False,
    "group_container": None,
    "id": "",
    "keyframe_graph_list": [],
    "keyframes": {
        "adjusts": [],
        "audios": [],
        "effects": [],
        "filters": [],
        "handwrites": [],
        "stickers": [],
        "texts": [],
        "videos": []
    },
    "last_modified_platform": {
        "app_id": 3704,
        "app_source": "lv",
        "app_version": "5.7.0",
        "device_id": "fc871fd0f7df9197856c41e5c14692e3",
        "hard_disk_id": "41242e7a5bd929da250d4f775eb50880",
        "mac_address": "bd3b6e089f498a7037dc279f6ee07f73",
        "os": "windows",
        "os_version": "10.0.19045"
    },
    "materials": {
        "audio_balances": [],
        "audio_effects": [],
        "audio_fades": [],
        "audios": [],
        "beats": [],
        "canvases": [],
        "chromas": [],
        "color_curves": [],
        "digital_humans": [],
        "drafts": [],
        "effects": [],
        "flowers": [],
        "green_screens": [],
        "handwrites": [],
        "hsl": [],
        "images": [],
        "log_color_wheels": [],
        "loudnesses": [],
        "manual_deformations": [],
        "masks": [],
        "material_animations": [],
        "material_colors": [],
        "placeholders": [],
        "plugin_effects": [],
        "primary_color_wheels": [],
        "realtime_denoises": [],
        "shapes": [],
        "smart_crops": [],
        "sound_channel_mappings": [],
        "speeds": [],
        "stickers": [],
        "tail_leaders": [],
        "text_templates": [],
        "texts": [],
        "transitions": [],
        "video_effects": [],
        "video_trackings": [],
        "videos": [],
        "vocal_beautifys": [],
        "vocal_separations": []
    },
    "mutable_config": None,
    "name": "",
    "new_version": "107.0.0",
    "platform": {
        "app_id": 3704,
        "app_source": "lv",
        "app_version": "5.7.0",
        "device_id": "08687eea10c150e0635f13a30a5d294b",
        "hard_disk_id": "6a8325c7d426485482a4e8d56419b4ea",
        "mac_address": "b180ab45d981991f3159d815fd05f164",
        "os": "windows",
        "os_version": "10.0.19045"
    },
    "relationships": [],
    "render_index_track_mode_on": False,
    "retouch_cover": None,
    "source": "default",
    "static_cover_image_path": "",
    "tracks": [],
    "update_time": 0,
    "version": 360000
}

draft_meta_data = {
    "cloud_package_completed_time": "",
    "draft_cloud_capcut_purchase_info": "",
    "draft_cloud_last_action_download": False,
    "draft_cloud_materials": [],
    "draft_cloud_purchase_info": "",
    "draft_cloud_template_id": "",
    "draft_cloud_tutorial_info": "",
    "draft_cloud_videocut_purchase_info": "",
    "draft_cover": "draft_cover.jpg",
    "draft_deeplink_url": "",
    "draft_enterprise_info": {
        "draft_enterprise_extra": "",
        "draft_enterprise_id": "",
        "draft_enterprise_name": "",
        "enterprise_material": []
    },
    "draft_fold_path": "",
    "draft_id": "",
    "draft_is_article_video_draft": False,
    "draft_is_from_deeplink": "false",
    "draft_materials": [
        {
            "type": 0,
            "value": []
        },
        {
            "type": 1,
            "value": []
        },
        {
            "type": 2,
            "value": []
        },
        {
            "type": 3,
            "value": []
        },
        {
            "type": 6,
            "value": []
        },
        {
            "type": 7,
            "value": []
        },
        {
            "type": 8,
            "value": []
        }
    ],
    "draft_materials_copied_info": [],
    "draft_name": "",
    "draft_new_version": "",
    "draft_removable_storage_device": "",
    "draft_root_path": "",
    "draft_segment_extra_info": [],
    "draft_timeline_materials_size_": 0,
    "tm_draft_cloud_completed": "",
    "tm_draft_cloud_modified": 0,
    "tm_draft_create": 0,
    "tm_draft_modified": 0,
    "tm_draft_removed": 0,
    "tm_duration": 0
}

draft_content_data_n = {
    "canvas_config": {
        "height": 0,
        "ratio": "original",
        "width": 0
    },
    "color_space": 0,
    "config": {
        "adjust_max_index": 1,
        "attachment_info": [],
        "combination_max_index": 1,
        "export_range": None,
        "extract_audio_last_index": 1,
        "lyrics_recognition_id": "",
        "lyrics_sync": True,
        "lyrics_taskinfo": [],
        "maintrack_adsorb": True,
        "material_save_mode": 0,
        "original_sound_last_index": 1,
        "record_audio_last_index": 1,
        "sticker_max_index": 1,
        "subtitle_recognition_id": "",
        "subtitle_sync": True,
        "subtitle_taskinfo": [],
        "system_font_list": [],
        "video_mute": False,
        "zoom_info_params": None
    },
    "cover": None,
    "create_time": 0,
    "duration": 20000000,
    "extra_info": None,
    "fps": 30.0,
    "free_render_index_mode_on": False,
    "group_container": None,
    "id": "",
    "keyframe_graph_list": [],
    "keyframes": {
        "adjusts": [],
        "audios": [],
        "effects": [],
        "filters": [],
        "handwrites": [],
        "stickers": [],
        "texts": [],
        "videos": []
    },
    "last_modified_platform": {
        "app_id": 3704,
        "app_source": "lv",
        "app_version": "5.7.0",
        "device_id": "fc871fd0f7df9197856c41e5c14692e3",
        "hard_disk_id": "41242e7a5bd929da250d4f775eb50880",
        "mac_address": "bd3b6e089f498a7037dc279f6ee07f73",
        "os": "windows",
        "os_version": "10.0.19045"
    },
    "materials": {
        "audio_balances": [],
        "audio_effects": [],
        "audio_fades": [],
        "audios": [],
        "beats": [],
        "canvases": [],
        "chromas": [],
        "color_curves": [],
        "digital_humans": [],
        "drafts": [],
        "effects": [],
        "flowers": [],
        "green_screens": [],
        "handwrites": [],
        "hsl": [],
        "images": [],
        "log_color_wheels": [],
        "loudnesses": [],
        "manual_deformations": [],
        "masks": [],
        "material_animations": [],
        "material_colors": [],
        "placeholders": [],
        "plugin_effects": [],
        "primary_color_wheels": [],
        "realtime_denoises": [],
        "shapes": [],
        "smart_crops": [],
        "sound_channel_mappings": [],
        "speeds": [],
        "stickers": [],
        "tail_leaders": [],
        "text_templates": [],
        "texts": [],
        "transitions": [],
        "video_effects": [],
        "video_trackings": [],
        "videos": [],
        "vocal_beautifys": [],
        "vocal_separations": []
    },
    "mutable_config": None,
    "name": "",
    "new_version": "107.0.0",
    "platform": {
        "app_id": 3704,
        "app_source": "lv",
        "app_version": "5.7.0",
        "device_id": "08687eea10c150e0635f13a30a5d294b",
        "hard_disk_id": "6a8325c7d426485482a4e8d56419b4ea",
        "mac_address": "b180ab45d981991f3159d815fd05f164",
        "os": "windows",
        "os_version": "10.0.19045"
    },
    "relationships": [],
    "render_index_track_mode_on": False,
    "retouch_cover": None,
    "source": "default",
    "static_cover_image_path": "",
    "tracks": [],
    "update_time": 0,
    "version": 360000
}

draft_meta_data_n = {
    "cloud_package_completed_time": "",
    "draft_cloud_capcut_purchase_info": "",
    "draft_cloud_last_action_download": False,
    "draft_cloud_materials": [],
    "draft_cloud_purchase_info": "",
    "draft_cloud_template_id": "",
    "draft_cloud_tutorial_info": "",
    "draft_cloud_videocut_purchase_info": "",
    "draft_cover": "draft_cover.jpg",
    "draft_deeplink_url": "",
    "draft_enterprise_info": {
        "draft_enterprise_extra": "",
        "draft_enterprise_id": "",
        "draft_enterprise_name": "",
        "enterprise_material": []
    },
    "draft_fold_path": "",
    "draft_id": "",
    "draft_is_article_video_draft": False,
    "draft_is_from_deeplink": "false",
    "draft_materials": [
        {
            "type": 0,
            "value": []
        },
        {
            "type": 1,
            "value": []
        },
        {
            "type": 2,
            "value": []
        },
        {
            "type": 3,
            "value": []
        },
        {
            "type": 6,
            "value": []
        },
        {
            "type": 7,
            "value": []
        },
        {
            "type": 8,
            "value": []
        }
    ],
    "draft_materials_copied_info": [],
    "draft_name": "",
    "draft_new_version": "",
    "draft_removable_storage_device": "",
    "draft_root_path": "",
    "draft_segment_extra_info": [],
    "draft_timeline_materials_size_": 0,
    "tm_draft_cloud_completed": "",
    "tm_draft_cloud_modified": 0,
    "tm_draft_create": 0,
    "tm_draft_modified": 0,
    "tm_draft_removed": 0,
    "tm_duration": 0
}
